package Forms;

import Classes.*;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.Timer;
import javax.swing.table.DefaultTableModel;

public class _UAdmin extends javax.swing.JFrame {
    static MInterface mi;
    static User cUser;
    static Curriculum curr;
    ArrayList<Curriculum> currList;
    ArrayList<Event> eventList;
    ArrayList<User> userList;
    ArrayList<Student> studentList;    
    ArrayList<Adviser> teacher;
    ArrayList<Object> profileList; //Summer
    Curriculum selectedC;
    User selectUser;
    Student s;
    Event selectEvent;
    SchoolYear selectSy;
    static String idno;
    String val;
    ArrayList<Object> list1; 
    ArrayList<Object> list12;
    
        DefaultTableModel dtm;
     
    DefaultTableModel dtmSum; //Summer
    
    static Edit_Student es;
    
    public _UAdmin(int tabSelected, User user, MInterface i) {
        setExtendedState(JFrame.MAXIMIZED_BOTH);        
        initComponents();
        setExtendedState(JFrame.MAXIMIZED_BOTH);
        //lockBtn.setVisible(false);
        try {            
            mi = i;
            mainP.setSelectedIndex(tabSelected);
            usernameL.setText(user.getName());
            timeL.setText(mi.getCurrentTime());
            dateL.setText(mi.getCurrentDate()); 
            
            loadAccountTbl();
            
            utypeCb.removeAllItems();
            utypeCb.addItem("All");
            ArrayList<String> listType = (ArrayList<String>) mi.getList("getlist-acctType").clone();
            for(int x = 0; x < listType.size(); x++) {
                utypeCb.addItem(listType.get(x));
            } 
            
//            list1 = new ArrayList<String>();
//            list = mi.getList("students");
//            ArrayList<Student> s = new ArrayList<Student>();
//            for(int x = 0; x < list.size(); x++){
//                Student ss = (Student) list.get(x);
//                s.add((Student) list.get(x));
//                idno1 = s.get(x).getSID().trim().toString();
//                list1.add(idno1);
//                
//            } 
//
            
                        list12 = mi.getList("gradeManage");
            ArrayList<Grades1> ss = new ArrayList<Grades1>();
            for(int x12 = 0; x12 < list12.size(); x12++) {
                ss.add((Grades1) list12.get(x12));
                
            }
            dtm = new DefaultTableModel(new String[] {studTbl.getColumnName(0), studTbl.getColumnName(1), studTbl.getColumnName(2)}, 0);
            studTbl.setModel(dtm);
            for(int x = 0; x < ss.size(); x++) {
           dtm.insertRow(x, new Object[] {ss.get(x).getidno(),ss.get(x).getname(),null});
            }
            
            
                   
            /*-- REGULAR SCHOOL YEAR --*/
//            if (mi.getCurrentDate().compareTo(mi.getEndSy(mi.getCurrentDate())) < 0) { // during regular s.y        
//                stList = mi.getList("curriculums");
//                ArrayList<Curriculum> curr = new ArrayList<Curriculum>(); 
//                for(int x = 0; x < stList.size(); x++) {   
//                    curr.add((Curriculum) stList.get(x));
//                }
//                      
////                String m1 = null;
////                String m2 = null;
////                for(int x = 0; x < curr.size(); x++) { 
////                    if(curr.get(x).getCurrStat().equals("Active")) {
////                        m1 = curr.get(x).getCurrName();
////                        JOptionPane.showMessageDialog(null, m1);
////                        m2 = curr.get(x).getCurrSY();
////                        JOptionPane.showMessageDialog(null, m2);
////                    }
////                }
////                if(m1 != null && m2 != null) {
////                    viewCurr = (Curriculum) mi.get("curriculum2", m2, m1);
////                    String m = mi.currStat(viewCurr, "Deactivated", cUser);
////                }
//                jButton56.setEnabled(false); // reg s.y                
//                jButton34.setEnabled(false); // add curr
//                jButton57.setEnabled(false); // manage curr
//                jButton16.setEnabled(false); // add class level
//                jButton18.setEnabled(false); // manage class level
//                jButton58.setEnabled(false); // add subj
//                jButton60.setEnabled(false); // manage subj
//                jButton45.setEnabled(false); // add stud
//                jButton47.setEnabled(false); // manage stud
//                jButton42.setEnabled(false); // add section
//                jButton20.setEnabled(false); // manage sect
//                jButton44.setEnabled(false); // section assign
//                jButton5.setEnabled(false); // summer stud
//                jButton6.setEnabled(false); // manage summer stud
//                jButton8.setEnabled(false); // add summer subj
//                jButton7.setEnabled(false); // manage summer subj
//                jButton12.setEnabled(false); // summer s.y 
//                jButton30.setEnabled(false); // event
//          //      lockBtn.setEnabled(false);  
//                lockBtn.setText("Unlock School Year");
//                lockGABtn.setText("Lock Grades and Attendance");
//                jButton29.setEnabled(true); // grades
//                jButton49.setEnabled(true); // attendance
//            } else if (mi.getCurrentDate().compareTo(mi.getEndSy(mi.getCurrentDate())) > 0) { // after regular s.y
////                stList = mi.getList("curriculums");
////                ArrayList<Curriculum> curr = new ArrayList<Curriculum>(); 
////                for(int x = 0; x < stList.size(); x++) {   
////                    curr.add((Curriculum) stList.get(x));
////                }
////                      
////                String m1 = null;
////                String m2 = null;
////                for(int x = 0; x < curr.size(); x++) { 
////                    if(curr.get(x).getCurrStat().equals("Active")) {
////                        m1 = curr.get(x).getCurrName();
////                        JOptionPane.showMessageDialog(null, m1);
////                        m2 = curr.get(x).getCurrSY();
////                        JOptionPane.showMessageDialog(null, m2);
////                    }
////                }
////                if(m1 != null && m2 != null) {
////                    viewCurr = (Curriculum) mi.get("curriculum2", m2, m1);
////                    String m = mi.currStat(viewCurr, "Deactivated", cUser);
////                }
//                jButton56.setEnabled(true); // reg s.y
//                jButton34.setEnabled(true); // add curr
//                jButton57.setEnabled(true); // manage curr
//                jButton16.setEnabled(true); // add class level
//                jButton18.setEnabled(true); // manage class level
//                jButton58.setEnabled(true); // add subj
//                jButton60.setEnabled(true); // manage subj
//                jButton45.setEnabled(true); // add stud
//                jButton47.setEnabled(true); // manage stud
//                jButton42.setEnabled(true); // add section
//                jButton20.setEnabled(true); // manage sect
//                jButton44.setEnabled(true); // section assign
//            //    lockBtn.setEnabled(true);  
//                jButton5.setEnabled(true); // summer stud
//                jButton6.setEnabled(true); // manage summer stud
//                jButton8.setEnabled(true); // add summer subj
//                jButton7.setEnabled(true); // manage summer subj
//                jButton12.setEnabled(true); // summer s.y
//                lockBtn.setText("Lock School Year");
//                lockGABtn.setText("Unlock Grades and Attendance");
//                jButton29.setEnabled(false); // grades
//                jButton49.setEnabled(false); // attendance
//                jButton30.setEnabled(true); // event
//            }         
//            
//            /*-- SUMMER SCHOOL YEAR --*/
//            if (mi.getCurrentDate().compareTo(mi.getEndSummer(mi.getCurrentDate())) > 0) { // during summer s.y
//                
//                jButton5.setEnabled(false); // summer stud
//                jButton6.setEnabled(false); // manage summer stud
//                jButton8.setEnabled(false); // add summer subj
//                jButton7.setEnabled(false); // manage summer subj
//                jButton12.setEnabled(false); // summer s.y 
//            //    lockBtn1.setEnabled(false);
//                jButton29.setEnabled(false); // grades
//                jButton49.setEnabled(false); // attendance
////                lockBtn1.setText("Unlock School Year");
//            } 
//            else if (mi.getCurrentDate().compareTo(mi.getEndSummer(mi.getCurrentDate())) < 0) { // after summer
//                jButton5.setEnabled(true); // summer stud
//                jButton6.setEnabled(true); // manage summer stud
//                jButton8.setEnabled(true); // add summer subj
//                jButton7.setEnabled(true); // manage summer subj
//                jButton12.setEnabled(true); // summer s.y 
////                lockBtn1.setEnabled(true);
//                jButton29.setEnabled(false); // grades
//                jButton49.setEnabled(false); // attendance
////                lockBtn1.setText("Lock School Year");
//            }
                        
            cUser = user; 
        } catch(Exception e) {
            e.printStackTrace();
        }
        
        ActionListener a = new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                try {
                    timeL.setText(mi.getCurrentTime());
                    dateL.setText(mi.getCurrentDate());
                } catch (Exception e) {
                    e.printStackTrace();
                }
                
            }
        };
        Timer t = new Timer(1000, a);
        t.start();
        
        /*loadSY();
        loadClevel();
        loadTbl1();*/
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        rbGrp = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        dateL = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        timeL = new javax.swing.JLabel();
        usernameL = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        mainP = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel11 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        userTbl = new javax.swing.JTable();
        searchFld1 = new javax.swing.JTextField();
        jButton7 = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        utypeCb = new javax.swing.JComboBox();
        acctNumLbl = new javax.swing.JLabel();
        jLabel78 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        acctTbl = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex){
                return false;
            }
        };
        jPanel12 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        unameFld = new javax.swing.JTextField();
        lname = new javax.swing.JTextField();
        gname = new javax.swing.JTextField();
        mname = new javax.swing.JTextField();
        acctCb = new javax.swing.JComboBox();
        jLabel49 = new javax.swing.JLabel();
        lvlCategory = new javax.swing.JComboBox();
        jLabel86 = new javax.swing.JLabel();
        pwFld = new javax.swing.JPasswordField();
        cPwFld = new javax.swing.JPasswordField();
        jLabel87 = new javax.swing.JLabel();
        jButton31 = new javax.swing.JButton();
        addBtn = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        jButton5 = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        jButton6 = new javax.swing.JButton();
        jPanel17 = new javax.swing.JPanel();
        jbuttonManageButton = new javax.swing.JButton();
        jPanel18 = new javax.swing.JPanel();
        manageButton = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        studTb = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex){
                return false;
            }
        }
        ;
        searchFld2 = new javax.swing.JTextField();
        jButton8 = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();
        syCB1 = new javax.swing.JComboBox();
        jLabel18 = new javax.swing.JLabel();
        currCB2 = new javax.swing.JComboBox();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jRadioButton3 = new javax.swing.JRadioButton();
        studNumLbl = new javax.swing.JLabel();
        jLabel82 = new javax.swing.JLabel();
        editBtn = new javax.swing.JButton();
        jButton35 = new javax.swing.JButton();
        secCb = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        clevelCb = new javax.swing.JComboBox();
        jButton36 = new javax.swing.JButton();
        jButton37 = new javax.swing.JButton();
        jButton38 = new javax.swing.JButton();
        jButton43 = new javax.swing.JButton();
        jPanel15 = new javax.swing.JPanel();
        jPanel16 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        sumstudTbl = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex){
                return false;
            }
        };
        sumSearchT = new javax.swing.JTextField();
        sumSearch = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        sumsyCB = new javax.swing.JComboBox();
        sumFld = new javax.swing.JLabel();
        jLabel88 = new javax.swing.JLabel();
        jButton39 = new javax.swing.JButton();
        jButton40 = new javax.swing.JButton();
        jButton33 = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jPanel20 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        studTbl = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex){
                return false;
            }
        };
        searchFld4 = new javax.swing.JTextField();
        jButton14 = new javax.swing.JButton();
        jLabel34 = new javax.swing.JLabel();
        syRepCb = new javax.swing.JComboBox();
        jLabel42 = new javax.swing.JLabel();
        clRepCb = new javax.swing.JComboBox();
        currFld16 = new javax.swing.JLabel();
        jLabel84 = new javax.swing.JLabel();
        jPanel21 = new javax.swing.JPanel();
        jLabel45 = new javax.swing.JLabel();
        idFld = new javax.swing.JTextField();
        jLabel46 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jButton2 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jPanel22 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        calTbl = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex){
                return false;
            }
        };
        searchFld5 = new javax.swing.JTextField();
        jButton16 = new javax.swing.JButton();
        jLabel43 = new javax.swing.JLabel();
        syCB5 = new javax.swing.JComboBox();
        eventNumLbl = new javax.swing.JLabel();
        jLabel85 = new javax.swing.JLabel();
        jPanel27 = new javax.swing.JPanel();
        jPanel28 = new javax.swing.JPanel();
        jLabel55 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jButton44 = new javax.swing.JButton();
        jButton45 = new javax.swing.JButton();
        startChooser = new com.toedter.calendar.JDateChooser();
        eveFld = new javax.swing.JTextField();
        endChooser = new com.toedter.calendar.JDateChooser();
        syCb = new javax.swing.JComboBox();
        jLabel59 = new javax.swing.JLabel();
        numLbl = new javax.swing.JLabel();
        computeBtn = new javax.swing.JButton();
        wclassRB = new javax.swing.JRadioButton();
        noclassRB = new javax.swing.JRadioButton();
        jLabel61 = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Administrator");

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Resources/banner.jpg"))); // NOI18N
        jLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        dateL.setFont(new java.awt.Font("Tahoma", 1, 14));
        dateL.setText("mm/dd/yy");

        jSeparator1.setForeground(new java.awt.Color(0, 102, 51));

        timeL.setFont(new java.awt.Font("Tahoma", 1, 14));
        timeL.setText("hh:mm am/pm");

        usernameL.setFont(new java.awt.Font("Tahoma", 1, 14));
        usernameL.setText("username");

        jButton1.setFont(new java.awt.Font("Tahoma", 0, 12));
        jButton1.setText("Logout");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        mainP.setFont(new java.awt.Font("Tahoma", 1, 14));
        mainP.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                mainPMouseClicked(evt);
            }
        });

        jPanel11.setBackground(new java.awt.Color(255, 255, 255));
        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "List of Accounts", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        userTbl.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Name", "Username", "User Type"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(userTbl);

        jButton7.setText("Search");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel13.setText("User Type:");

        utypeCb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All" }));
        utypeCb.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                utypeCbActionPerformed(evt);
            }
        });

        acctNumLbl.setFont(new java.awt.Font("Tahoma", 0, 14));
        acctNumLbl.setText("0000");

        jLabel78.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel78.setText("No. of Entries:");

        acctTbl.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Username", "Account Type"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        acctTbl.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                acctTblMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(acctTbl);

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 535, Short.MAX_VALUE)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(searchFld1, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(utypeCb, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel78)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(acctNumLbl)))
                .addContainerGap())
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel11Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 535, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton7)
                    .addComponent(utypeCb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13)
                    .addComponent(searchFld1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                .addGap(371, 371, 371)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel78)
                    .addComponent(acctNumLbl))
                .addContainerGap())
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel11Layout.createSequentialGroup()
                    .addGap(43, 43, 43)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 362, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(34, Short.MAX_VALUE)))
        );

        jPanel12.setBackground(new java.awt.Color(255, 255, 255));
        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "User Information", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel12.setText("Username:");

        jLabel14.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel14.setText("Account Type:");

        jLabel15.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel15.setText("Last Name:");

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel16.setText("Given Name:");

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel17.setText("Middle Name:");

        unameFld.setEnabled(false);

        lname.setEnabled(false);

        gname.setEnabled(false);

        mname.setEnabled(false);

        acctCb.setFont(new java.awt.Font("Tahoma", 0, 12));
        acctCb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Administrator", "Adviser", "Secretary" }));
        acctCb.setEnabled(false);
        acctCb.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                acctCbActionPerformed(evt);
            }
        });

        jLabel49.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel49.setText("Level Category:");

        lvlCategory.setFont(new java.awt.Font("Tahoma", 0, 12));
        lvlCategory.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Pre-Elementary", "Elementary", "High School" }));
        lvlCategory.setEnabled(false);
        lvlCategory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                lvlCategoryActionPerformed(evt);
            }
        });

        jLabel86.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel86.setText("Password:");

        pwFld.setFont(new java.awt.Font("Tahoma", 0, 12));
        pwFld.setEnabled(false);
        pwFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                pwFldKeyTyped(evt);
            }
        });

        cPwFld.setFont(new java.awt.Font("Tahoma", 0, 12));
        cPwFld.setEnabled(false);
        cPwFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                cPwFldKeyTyped(evt);
            }
        });

        jLabel87.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel87.setText("Confirm Password:");

        jButton31.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton31.setText("Edit");

        addBtn.setFont(new java.awt.Font("Tahoma", 0, 14));
        addBtn.setText("Add");
        addBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jLabel14)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(acctCb, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jLabel87)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cPwFld))
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jLabel16)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(gname))
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jLabel17)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(mname))
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jLabel15)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(lname))
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jLabel49)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(lvlCategory, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jLabel12)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(unameFld, javax.swing.GroupLayout.PREFERRED_SIZE, 398, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel13Layout.createSequentialGroup()
                            .addComponent(jLabel86)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(pwFld)))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(addBtn)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton31)))
                .addContainerGap(189, Short.MAX_VALUE))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(unameFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(acctCb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel86)
                    .addComponent(pwFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel87)
                    .addComponent(cPwFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(lname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel16)
                    .addComponent(gname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(mname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel49)
                    .addComponent(lvlCategory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 80, Short.MAX_VALUE)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addBtn)
                    .addComponent(jButton31))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        mainP.addTab("Account", jPanel1);

        jPanel9.setBackground(new java.awt.Color(255, 255, 255));
        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Curriculum", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        jButton5.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton5.setText("Manage Curriculum");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 44, Short.MAX_VALUE)
                .addGap(21, 21, 21))
        );

        jPanel10.setBackground(new java.awt.Color(255, 255, 255));
        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Class Level", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        jButton6.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton6.setText("Manage Class Level");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, 44, Short.MAX_VALUE)
                .addGap(21, 21, 21))
        );

        jPanel17.setBackground(new java.awt.Color(255, 255, 255));
        jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Subject", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        jbuttonManageButton.setFont(new java.awt.Font("Tahoma", 0, 14));
        jbuttonManageButton.setText("Manage Subject");
        jbuttonManageButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbuttonManageButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jbuttonManageButton, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                .addGap(11, 11, 11))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jbuttonManageButton, javax.swing.GroupLayout.DEFAULT_SIZE, 44, Short.MAX_VALUE)
                .addGap(21, 21, 21))
        );

        jPanel18.setBackground(new java.awt.Color(255, 255, 255));
        jPanel18.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Section", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        manageButton.setFont(new java.awt.Font("Tahoma", 0, 14));
        manageButton.setText("Manage Section");
        manageButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                manageButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(manageButton, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
                .addGap(11, 11, 11))
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(manageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(21, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(313, 313, 313)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29)
                .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(267, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(516, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(443, 443, 443))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(457, 457, 457))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(73, 73, 73)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(46, Short.MAX_VALUE))
        );

        mainP.addTab("School Year, Curriculum, Class Level, Subject and Section", jPanel3);

        jPanel14.setBackground(new java.awt.Color(255, 255, 255));
        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "List of Students", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        studTb.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID Number", "Student Name", "School Year", "Curriculum", "Class Level", "Section", "General Average", "Status"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        studTb.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                studTbMouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(studTb);

        jButton8.setText("Search");

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel11.setText("School Year:");

        syCB1.setFont(new java.awt.Font("Tahoma", 0, 14));
        syCB1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All" }));

        jLabel18.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel18.setText("Curriculum:");

        currCB2.setFont(new java.awt.Font("Tahoma", 0, 14));
        currCB2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All" }));

        jRadioButton1.setFont(new java.awt.Font("Tahoma", 0, 14));
        jRadioButton1.setText("Transferee");

        jRadioButton2.setFont(new java.awt.Font("Tahoma", 0, 14));
        jRadioButton2.setText("Graduate");

        jRadioButton3.setFont(new java.awt.Font("Tahoma", 0, 14));
        jRadioButton3.setText("Old Student");

        studNumLbl.setFont(new java.awt.Font("Tahoma", 0, 14));
        studNumLbl.setText("0000");

        jLabel82.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel82.setText("No. of Entries:");

        editBtn.setFont(new java.awt.Font("Tahoma", 0, 14));
        editBtn.setText("View/Edit");
        editBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editBtnActionPerformed(evt);
            }
        });

        jButton35.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton35.setText("Add");
        jButton35.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton35ActionPerformed(evt);
            }
        });

        secCb.setFont(new java.awt.Font("Tahoma", 0, 14));
        secCb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All" }));

        jLabel19.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel19.setText("Section:");

        jLabel20.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel20.setText("Class Level:");

        clevelCb.setFont(new java.awt.Font("Tahoma", 0, 14));
        clevelCb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "All" }));

        jButton36.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton36.setText("Promote Student");
        jButton36.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton36ActionPerformed(evt);
            }
        });

        jButton37.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton37.setText("Section Assignment");
        jButton37.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton37ActionPerformed(evt);
            }
        });

        jButton38.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton38.setText("Grades");
        jButton38.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton38ActionPerformed(evt);
            }
        });

        jButton43.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton43.setText("Attendance");
        jButton43.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton43ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1260, Short.MAX_VALUE)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(searchFld2, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(syCB1, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel18)
                        .addGap(5, 5, 5)
                        .addComponent(currCB2, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(clevelCb, 0, 62, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel19)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(secCb, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(jRadioButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jRadioButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jRadioButton3)
                        .addGap(0, 987, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel82)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(studNumLbl)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 322, Short.MAX_VALUE)
                        .addComponent(jButton36)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton37)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton38)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton43)
                        .addGap(165, 165, 165)
                        .addComponent(jButton35)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(editBtn)))
                .addContainerGap())
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton1)
                    .addComponent(jRadioButton2)
                    .addComponent(jRadioButton3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(syCB1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchFld2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton8)
                    .addComponent(currCB2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18)
                    .addComponent(clevelCb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20)
                    .addComponent(jLabel19)
                    .addComponent(secCb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton35)
                        .addComponent(editBtn)
                        .addComponent(jLabel82)
                        .addComponent(studNumLbl))
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton36)
                        .addComponent(jButton37)
                        .addComponent(jButton38)
                        .addComponent(jButton43)))
                .addGap(21, 21, 21))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE)
                .addContainerGap())
        );

        mainP.addTab("Student, Grades and Attendance", jPanel4);

        jPanel16.setBackground(new java.awt.Color(255, 255, 255));
        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "List of Students", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        sumstudTbl.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID Number", "Student Name", "School Year"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane8.setViewportView(sumstudTbl);

        sumSearch.setText("Search");
        sumSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sumSearchActionPerformed(evt);
            }
        });

        jLabel21.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel21.setText("School Year:");

        sumsyCB.setFont(new java.awt.Font("Tahoma", 0, 14));

        sumFld.setFont(new java.awt.Font("Tahoma", 0, 14));
        sumFld.setText("0000");

        jLabel88.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel88.setText("No. of Entries:");

        jButton39.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton39.setText("Edit");
        jButton39.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton39ActionPerformed(evt);
            }
        });

        jButton40.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton40.setText("Add");
        jButton40.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton40ActionPerformed(evt);
            }
        });

        jButton33.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton33.setText("View/Open School Year ");
        jButton33.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton33ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel16Layout.createSequentialGroup()
                        .addComponent(jLabel88)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(sumFld)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 822, Short.MAX_VALUE)
                        .addComponent(jButton33)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton40)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton39))
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 1260, Short.MAX_VALUE)
                    .addGroup(jPanel16Layout.createSequentialGroup()
                        .addComponent(sumSearchT, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(sumSearch)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel21)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(sumsyCB, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(sumsyCB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sumSearchT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sumSearch))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel88)
                    .addComponent(sumFld)
                    .addComponent(jButton40)
                    .addComponent(jButton39)
                    .addComponent(jButton33))
                .addGap(11, 11, 11))
        );

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        mainP.addTab("Summer Program", jPanel15);

        jPanel20.setBackground(new java.awt.Color(255, 255, 255));
        jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "List of Students", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        studTbl.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID Number", "Student Name", "School Year"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                true, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane6.setViewportView(studTbl);
        studTbl.getColumnModel().getColumn(2).setHeaderValue("End Date");

        jButton14.setText("Search");

        jLabel34.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel34.setText("School Year:");

        jLabel42.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel42.setText("Class Level:");

        currFld16.setFont(new java.awt.Font("Tahoma", 0, 14));
        currFld16.setText("0000");

        jLabel84.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel84.setText("No. of Entries:");

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel20Layout.createSequentialGroup()
                        .addComponent(searchFld4, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
                        .addComponent(jLabel42)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(clRepCb, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel34)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(syRepCb, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 638, Short.MAX_VALUE)
                    .addGroup(jPanel20Layout.createSequentialGroup()
                        .addComponent(jLabel84)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(currFld16)
                        .addGap(0, 501, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel34)
                    .addComponent(syRepCb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchFld4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton14)
                    .addComponent(jLabel42)
                    .addComponent(clRepCb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 365, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel84)
                    .addComponent(currFld16))
                .addContainerGap())
        );

        jPanel21.setBackground(new java.awt.Color(255, 255, 255));
        jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Report Settings", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        jLabel45.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel45.setText("ID Number:");

        jLabel46.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel46.setText("Report Type:");

        jComboBox1.setFont(new java.awt.Font("Tahoma", 0, 14));

        jButton2.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton2.setText("Generate Report");
        jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton2MouseClicked(evt);
            }
        });
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addContainerGap(132, Short.MAX_VALUE)
                .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel21Layout.createSequentialGroup()
                        .addComponent(jLabel45)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(idFld))
                    .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel21Layout.createSequentialGroup()
                        .addComponent(jLabel46)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(115, 115, 115))
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addGap(149, 149, 149)
                .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel45)
                    .addComponent(idFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel46)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(194, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        mainP.addTab("Report", jPanel6);

        jPanel22.setBackground(new java.awt.Color(255, 255, 255));
        jPanel22.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "List of Events", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        calTbl.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "School Year", "Event Name"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        calTbl.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                calTblMouseClicked(evt);
            }
        });
        jScrollPane7.setViewportView(calTbl);

        jButton16.setText("Search");

        jLabel43.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel43.setText("School Year:");

        eventNumLbl.setFont(new java.awt.Font("Tahoma", 0, 14));
        eventNumLbl.setText("0000");

        jLabel85.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel85.setText("No. of Entries:");

        javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
        jPanel22.setLayout(jPanel22Layout);
        jPanel22Layout.setHorizontalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel22Layout.createSequentialGroup()
                        .addComponent(searchFld5, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton16)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel43)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(syCB5, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 638, Short.MAX_VALUE)
                    .addGroup(jPanel22Layout.createSequentialGroup()
                        .addComponent(jLabel85)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(eventNumLbl)
                        .addGap(0, 501, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel22Layout.setVerticalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(syCB5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchFld5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel43)
                    .addComponent(jButton16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 365, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel85)
                    .addComponent(eventNumLbl))
                .addContainerGap())
        );

        jPanel27.setBackground(new java.awt.Color(255, 255, 255));
        jPanel27.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Event Information", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        jLabel55.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel55.setText("School Year:");

        jLabel56.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel56.setText("Start Date:");

        jLabel57.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel57.setText("End Date:");

        jLabel58.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel58.setText("Event Name:");

        jButton44.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton44.setText("Add");
        jButton44.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton44ActionPerformed(evt);
            }
        });

        jButton45.setFont(new java.awt.Font("Tahoma", 0, 14));
        jButton45.setText("Edit");
        jButton45.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton45ActionPerformed(evt);
            }
        });

        startChooser.setDateFormatString("yyyy-MM-dd");
        startChooser.setEnabled(false);
        startChooser.setFont(new java.awt.Font("Tahoma", 0, 12));

        eveFld.setEditable(false);
        eveFld.setFont(new java.awt.Font("Tahoma", 0, 12));

        endChooser.setDateFormatString("yyyy-MM-dd");
        endChooser.setEnabled(false);
        endChooser.setFont(new java.awt.Font("Tahoma", 0, 12));

        syCb.setFont(new java.awt.Font("Tahoma", 0, 12));
        syCb.setEnabled(false);

        jLabel59.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel59.setText("Number of School Days:");

        numLbl.setFont(new java.awt.Font("Tahoma", 1, 14));
        numLbl.setText("000");

        computeBtn.setFont(new java.awt.Font("Tahoma", 0, 12));
        computeBtn.setText("Compute");
        computeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                computeBtnActionPerformed(evt);
            }
        });

        wclassRB.setBackground(new java.awt.Color(255, 255, 255));
        rbGrp.add(wclassRB);
        wclassRB.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        wclassRB.setText("with Classes");

        noclassRB.setBackground(new java.awt.Color(255, 255, 255));
        rbGrp.add(noclassRB);
        noclassRB.setFont(new java.awt.Font("Tahoma", 0, 12));
        noclassRB.setText("No Classes");

        jLabel61.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel61.setText("Remarks:");

        javax.swing.GroupLayout jPanel28Layout = new javax.swing.GroupLayout(jPanel28);
        jPanel28.setLayout(jPanel28Layout);
        jPanel28Layout.setHorizontalGroup(
            jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel28Layout.createSequentialGroup()
                        .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel28Layout.createSequentialGroup()
                                .addComponent(jButton44)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton45))
                            .addGroup(jPanel28Layout.createSequentialGroup()
                                .addComponent(jLabel55)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(syCb, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 323, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel28Layout.createSequentialGroup()
                        .addComponent(jLabel59)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(numLbl)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 289, Short.MAX_VALUE)
                        .addComponent(computeBtn))
                    .addGroup(jPanel28Layout.createSequentialGroup()
                        .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel58)
                            .addComponent(jLabel56)
                            .addComponent(jLabel57)
                            .addComponent(jLabel61))
                        .addGap(4, 4, 4)
                        .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel28Layout.createSequentialGroup()
                                .addComponent(noclassRB)
                                .addGap(18, 18, 18)
                                .addComponent(wclassRB))
                            .addComponent(endChooser, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
                            .addComponent(startChooser, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
                            .addComponent(eveFld, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel28Layout.setVerticalGroup(
            jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel55)
                    .addComponent(syCb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel58)
                    .addComponent(eveFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel56)
                    .addComponent(startChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel57)
                    .addComponent(endChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel61)
                    .addComponent(noclassRB)
                    .addComponent(wclassRB))
                .addGap(17, 17, 17)
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(numLbl)
                    .addComponent(jLabel59)
                    .addComponent(computeBtn))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 165, Short.MAX_VALUE)
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton44)
                    .addComponent(jButton45))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel27Layout = new javax.swing.GroupLayout(jPanel27);
        jPanel27.setLayout(jPanel27Layout);
        jPanel27Layout.setHorizontalGroup(
            jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel27Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel27Layout.setVerticalGroup(
            jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel27Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel27, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        mainP.addTab("Calendar", jPanel7);

        jSeparator2.setForeground(new java.awt.Color(0, 102, 51));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(dateL)
                        .addGap(53, 53, 53)
                        .addComponent(timeL)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(usernameL)
                        .addGap(18, 18, 18)
                        .addComponent(jButton1))
                    .addComponent(jSeparator1)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(jSeparator2)
                    .addComponent(mainP, javax.swing.GroupLayout.PREFERRED_SIZE, 1317, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(dateL)
                    .addComponent(timeL)
                    .addComponent(usernameL)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(mainP, javax.swing.GroupLayout.PREFERRED_SIZE, 522, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void acctCbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acctCbActionPerformed
        if (acctCb.getSelectedItem().equals("Adviser")) {
            lvlCategory.setEnabled(true);            
        } else if (acctCb.getSelectedItem().equals("Administrator") || acctCb.getSelectedItem().equals("Secretary")) {
            lvlCategory.setEnabled(false);
        }
   }//GEN-LAST:event_acctCbActionPerformed

    private void lvlCategoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lvlCategoryActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_lvlCategoryActionPerformed

    private void pwFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_pwFldKeyTyped
// TODO add your handling code here:
        /*String s = "!@#$%^&*()-+=~`|/?.>,<][}{;:\'\" ";

        char c = evt.getKeyChar();
        //String s = "-!@#$%^&*()+=~`|/?.>,<][}{;:\'\"";

        //char c = evt.getKeyChar();
        if (s.contains(c + "") || c == KeyEvent.VK_BACK_SLASH || c == KeyEvent.VK_SPACE || c == KeyEvent.VK_ENTER) {
            if (c == KeyEvent.VK_ENTER) {
                jButton7ActionPerformed(null);
            } else {
                evt.consume();
                JOptionPane.showMessageDialog(null, "Please enter allowed characters.", "Error", JOptionPane.ERROR_MESSAGE);
                jLabel12.setForeground(Color.red);
            }
        }*/

        /*
         * if ("".equals(jPasswordField2.getPassword().toString()) ){
         * jLabel12.setForeground(Color.black);
    }
         */
        /*
         * if (s.contains(c + "") || c == KeyEvent.VK_BACK_SLASH || c ==
         * KeyEvent.VK_SPACE || c == KeyEvent.VK_ENTER){
         *
         * }
         */

        /*
         * if (!Character.isLetter(c) && c != KeyEvent.VK_SPACE && c !=
         * KeyEvent.VK_BACK_SPACE && !Character.isDigit(c) &&
         * !Character.isSpaceChar(c)){ evt.consume();
         * JOptionPane.showMessageDialog (null, "Please enter allowed
         * characters.", "Error", JOptionPane.ERROR_MESSAGE);
         * jLabel12.setForeground(Color.red);
    }
         */



    }//GEN-LAST:event_pwFldKeyTyped

    private void cPwFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cPwFldKeyTyped
// TODO add your handling code here:
        /*String s = "!@#$%^&*()-+=~`|/?.>,<][}{;:\'\" ";
        char c = evt.getKeyChar();

        if (s.contains(c + "") || c == KeyEvent.VK_BACK_SLASH || c == KeyEvent.VK_SPACE || c == KeyEvent.VK_ENTER) {
            if (c == KeyEvent.VK_ENTER) {
                jButton7ActionPerformed(null);
            } else {
                evt.consume();
                JOptionPane.showMessageDialog(null, "Please enter allowed characters.", "Error", JOptionPane.ERROR_MESSAGE);
                jLabel17.setForeground(Color.red);
            }
        }*/
        /*
         * if (s.contains(c + "") || c == KeyEvent.VK_BACK_SLASH || c ==
         * KeyEvent.VK_SPACE || c == KeyEvent.VK_ENTER){
         *
         * }
         * if (!Character.isLetter(c) && c != KeyEvent.VK_SPACE && c !=
         * KeyEvent.VK_BACK_SPACE && !Character.isDigit(c)){ evt.consume();
         * JOptionPane.showMessageDialog (null, "Please enter allowed
         * characters.", "Error", JOptionPane.ERROR_MESSAGE);
         * jLabel17.setForeground(Color.red);
    }
         */

    }//GEN-LAST:event_cPwFldKeyTyped

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton7ActionPerformed

    private void addBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBtnActionPerformed
        if (addBtn.getText().equals("Add")) {
            unameFld.setEnabled(true);
            acctCb.setEnabled(true);
            pwFld.setEnabled(true);
            cPwFld.setEnabled(true);
            lname.setEnabled(true);
            gname.setEnabled(true);
            mname.setEnabled(true);
            addBtn.setText("Save");
        } else if (addBtn.getText().equals("Save")) { 
            try {
                boolean exist = false;
                if (acctCb.getSelectedItem().equals("Adviser")) {
                    lvlCategory.setEnabled(true);
                    String pw1 = new String(pwFld.getPassword());
                    String pw2 = new String(cPwFld.getPassword());
                    if (!pw1.equals(pw2)) {
                        JOptionPane.showMessageDialog(null, "Password does not match", "Error", JOptionPane.ERROR_MESSAGE);
                        jLabel86.setForeground(Color.red);
                        jLabel87.setForeground(Color.red);
                    } else if (pw1.length() < 7) {
                        JOptionPane.showMessageDialog(null, "Password too short. Password should contain at least 7 characters", "Error", JOptionPane.ERROR_MESSAGE);
                        jLabel86.setForeground(Color.red);
                        jLabel87.setForeground(Color.red);
                    } else {    
                        boolean addA = false;
  //                      String u;
                        User user = new User(lname.getText().replaceAll("\\s+", " "), gname.getText().replaceAll("\\s+", " "), mname.getText().replaceAll("\\s+", " "), unameFld.getText(), pw1, (String) acctCb.getSelectedItem());
                        //String add = mi.addUser(user); 
                        exist = mi.add("add-user", user, "", cUser);
                        User uu = (User) mi.get("get-user", unameFld.getText(), ""); 
//                        u = uu.getID();
                        if(acctTbl.getRowCount() == 2) {
                            boolean a1 = mi.add("add-classadviser", new Adviser(lvlCategory.getSelectedIndex(), Integer.valueOf(uu.getID())), "", cUser);
                            boolean a2 = mi.add("add-classadviser", new Adviser(lvlCategory.getSelectedIndex(), Integer.valueOf(uu.getID())), "", cUser);
                            if(a1 && a2) addA = true;
                        } else {
                            addA = mi.add("add-classadviser", new Adviser(lvlCategory.getSelectedIndex(), Integer.parseInt(uu.getID())), "", cUser);
                        }
                        if(addA && exist) {
                            JOptionPane.showMessageDialog(null, unameFld.getText() + " was successfully added", "Message", JOptionPane.INFORMATION_MESSAGE);
                        }         
                        unameFld.setText("");
                        pwFld.setText("");
                        cPwFld.setText("");
                        lname.setText("");
                        gname.setText("");
                        mname.setText("");
                        unameFld.setEnabled(false);
                        acctCb.setEnabled(false);
                        pwFld.setEnabled(false);
                        cPwFld.setEnabled(false);
                        lname.setEnabled(false);
                        gname.setEnabled(false);
                        mname.setEnabled(false);
                        lvlCategory.setEnabled(false);
                        addBtn.setText("Add");
                    }
                } else if (acctCb.getSelectedItem().equals("Administrator") || acctCb.getSelectedItem().equals("Secretary")){
                    lvlCategory.setEnabled(false);                    
                    String pw1 = new String(pwFld.getPassword());
                    String pw2 = new String(cPwFld.getPassword());
                    if (!pw1.equals(pw2)) {
                        JOptionPane.showMessageDialog(null, "Password does not match", "Error", JOptionPane.ERROR_MESSAGE);
                        jLabel86.setForeground(Color.red);
                        jLabel87.setForeground(Color.red);
                    } else if (pw1.length() < 7) {
                        JOptionPane.showMessageDialog(null, "Password too short. Password should contain at least 7 characters", "Error", JOptionPane.ERROR_MESSAGE);
                        jLabel86.setForeground(Color.red);
                        jLabel87.setForeground(Color.red);
                    } else {                        
                        User user = new User(lname.getText().replaceAll("\\s+", " "), gname.getText().replaceAll("\\s+", " "), mname.getText().replaceAll("\\s+", " "), unameFld.getText(), pw1, (String) acctCb.getSelectedItem());
                        exist = mi.add("add-user", user, "", user);     
                        JOptionPane.showMessageDialog(null, unameFld.getText() + " was successfully added", "Message", JOptionPane.INFORMATION_MESSAGE);
                        unameFld.setText("");
                        pwFld.setText("");
                        cPwFld.setText("");
                        lname.setText("");
                        gname.setText("");
                        mname.setText("");
                        unameFld.setEnabled(false);
                        acctCb.setEnabled(false);
                        pwFld.setEnabled(false);
                        cPwFld.setEnabled(false);
                        lname.setEnabled(false);
                        gname.setEnabled(false);
                        mname.setEnabled(false);
                        addBtn.setText("Add");
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }//GEN-LAST:event_addBtnActionPerformed

    private void editBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editBtnActionPerformed
        if(studTb.getSelectedRows().length == 0) {
             JOptionPane.showMessageDialog(null, "No row selected!", "Error", JOptionPane.ERROR_MESSAGE);
        } else {
            System.out.println(studentList.get(studTb.getSelectedRow()).getStuID() + " " + studentList.get(studTb.getSelectedRow()).getSID());
            new ProfileS_Manage(cUser, mi, studentList.get(studTb.getSelectedRow())).setVisible(true);
        }
    }//GEN-LAST:event_editBtnActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        int x = JOptionPane.showConfirmDialog(null,"Are you sure you want to logout already?","Alert!",JOptionPane.YES_NO_OPTION);        
        if(x == JOptionPane.YES_OPTION){
            try {
                mi.logout(cUser.getUsername());
                this.setVisible(false);
                new _Login().setVisible(true);
            } catch(Exception e) {
                e.printStackTrace();
            }
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton39ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton39ActionPerformed
        if(!sumstudTbl.getValueAt(sumstudTbl.getSelectedRow(), 0).toString().isEmpty()) {
            new SumStudent(cUser, mi, sumstudTbl.getValueAt(sumstudTbl.getSelectedRow(), 0).toString(),  sumstudTbl.getValueAt(sumstudTbl.getSelectedRow(), 2).toString()).setVisible(true);
            sumstudTbl.clearSelection();
//            jButton39.setEnabled(false);
        }else {
            JOptionPane.showMessageDialog(null, "Please Select the Student to Edit", "Message", JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_jButton39ActionPerformed

    private void jButton36ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton36ActionPerformed
        new PromoteAssign(mi, cUser).setVisible(true);
    }//GEN-LAST:event_jButton36ActionPerformed

    private void jButton37ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton37ActionPerformed
        new SectionA_Manage(cUser, mi).setVisible(true);
    }//GEN-LAST:event_jButton37ActionPerformed

    private void jButton38ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton38ActionPerformed
        new AddGrades(mi,cUser).setVisible(true);
    }//GEN-LAST:event_jButton38ActionPerformed

    private void jButton35ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton35ActionPerformed
       new ProfileS_Manage(cUser, mi, null).setVisible(true);
//        new AddStudent(cUser, mi, curr).setVisible(true);
    }//GEN-LAST:event_jButton35ActionPerformed

    private void jButton33ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton33ActionPerformed
        new OpenSumSY(cUser, mi).setVisible(true);
    }//GEN-LAST:event_jButton33ActionPerformed

    private void jButton40ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton40ActionPerformed
        String yr = null;
        ArrayList<Object> ssl = new ArrayList<Object>();
        try {
            yr = mi.getYear();
            ssl = mi.cbList("cb-summer");
            for(int x = 0; x < ssl.size(); x++) {
                if(ssl.get(x).toString().contains(yr)) {
                    new SumStudent(cUser, mi, "", ssl.get(x).toString()).setVisible(true); 
                    break;
                }
            }
        }catch (Exception e) {
            e.printStackTrace();
            JOptionPane.showMessageDialog(null, "No Summer for this Year", "Information", JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_jButton40ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton43ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton43ActionPerformed
       //  new AttendanceS_Manage().setVisible(true);
    }//GEN-LAST:event_jButton43ActionPerformed

    private void mainPMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_mainPMouseClicked
        if (mainP.getSelectedIndex() == 0) {
            loadAccountTbl();
        } else if(mainP.getSelectedIndex() == 1) {
            
            selectedC = null;
            try {
                
                ArrayList<SchoolYear> listsy = (ArrayList<SchoolYear>) mi.getList("getlist-sylist").clone();
                for(int x = 0; x < listsy.size(); x++) {
                    
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (mainP.getSelectedIndex() == 2) {            
            loadStudentTbl(); 
            try {
                syCB1.removeAllItems();
                syCB1.addItem("All");
                ArrayList<SchoolYear> listsy = (ArrayList<SchoolYear>) mi.getList("getlist-sylist").clone();
                for(int x = 0; x < listsy.size(); x++) {
                    syCB1.addItem(listsy.get(x).getSyName());
                }
                
                currCB2.removeAllItems();
                currCB2.addItem("All");
                ArrayList<String> cbCurr = (ArrayList<String>) mi.getList("getlist-currCb").clone();
                for (int x = 0; x < cbCurr.size(); x++) {
                    currCB2.addItem(cbCurr.get(x));
                }
                
                clevelCb.removeAllItems();  
                clevelCb.addItem("All");
                ArrayList<String> cbLevel = (ArrayList<String>) mi.getList("get-classlevel").clone();
                for (int x = 0; x < cbLevel.size(); x++) {
                    clevelCb.addItem(cbLevel.get(x));                
                }
                
                secCb.removeAllItems();
                secCb.addItem("All");
                ArrayList<String> cbSec = (ArrayList<String>) mi.getList("getlist-section").clone();
                for (int x = 0; x < cbSec.size(); x++) {
                    secCb.addItem(cbSec.get(x));
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (mainP.getSelectedIndex() == 3) {
            try {
                sumsyCB.removeAllItems();
                ArrayList<Object> scb = new ArrayList<Object>();
                scb = mi.cbList("cb-summer");
                for(int x = 0; x < scb.size(); x++) {
                    sumsyCB.addItem(scb.get(x).toString());
                }
            
                profileList = mi.getList("getlist-summer");
                sumFld.setText(profileList.size() + "");
            
                dtmSum = new DefaultTableModel(new String[] {sumstudTbl.getColumnName(0), sumstudTbl.getColumnName(1), sumstudTbl.getColumnName(2)}, 0);
                sumstudTbl.setModel(dtmSum);
                for(int x = 0; x < profileList.size(); x++) {
                    Summer sp = (Summer) profileList.get(x);
                    dtmSum.insertRow(x, new Object[] {sp.getSSID(), sp.getSummerName(), sp.getSSYID()});                
//                    sumsyCB.addItem(sp.getSSYID()); //Change location to avoid duplication
                }             
            } catch (Exception e) {
                e.printStackTrace();
            }    
        } else if (mainP.getSelectedIndex() == 4) {
            try {
                clRepCb.removeAllItems();
                clRepCb.addItem("All");
                ArrayList<String> cbCurr = (ArrayList<String>) mi.getList("get-classlevel").clone();
                for (int x = 0; x < cbCurr.size(); x++) {
                    clRepCb.addItem(cbCurr.get(x));
                }
                
                syRepCb.removeAllItems();
                syRepCb.addItem("All");
                ArrayList<SchoolYear> listsy = (ArrayList<SchoolYear>) mi.getList("getlist-sylist").clone();
                for(int x = 0; x < listsy.size(); x++) {
                    syRepCb.addItem(listsy.get(x).getSyName());
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (mainP.getSelectedIndex() == 5) {
            loadEventTbl();
            try {
                syCB5.removeAllItems();
                syCb.removeAllItems();
                ArrayList<SchoolYear> listsy = (ArrayList<SchoolYear>) mi.getList("getlist-sylist").clone();
                for(int x = 0; x < listsy.size(); x++) {
                    syCB5.addItem(listsy.get(x).getSyName());
                    syCb.addItem(listsy.get(x).getSyName());
                }   
                String s = syCb.getSelectedItem().toString();
                selectSy = mi.getDays(s);
                numLbl.setText(String.valueOf(selectSy.getNumOfDays()));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }//GEN-LAST:event_mainPMouseClicked

    private void jButton44ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton44ActionPerformed
        try {
            if (jButton44.getText().equals("Add")) {
                jButton44.setText("Save");
                jButton45.setText("Cancel");
                
                syCb.setEnabled(true);
                eveFld.setEditable(true);
                startChooser.setEnabled(true);
                endChooser.setEnabled(true);
                
                eveFld.setText("");
                ((JTextField)startChooser.getDateEditor().getUiComponent()).setText("");
                ((JTextField)endChooser.getDateEditor().getUiComponent()).setText("");                
            } else if (jButton44.getText().equals("Save")) {
                jButton45.setText("Cancel");
                String start = ((JTextField)startChooser.getDateEditor().getUiComponent()).getText();
                String end = ((JTextField)endChooser.getDateEditor().getUiComponent()).getText();
                if (start.isEmpty() || eveFld.getText().isEmpty()) {
                    JOptionPane.showMessageDialog(null, "Please fill in the necessary fields", "Error", JOptionPane.ERROR_MESSAGE);
                } 
//                else if (start.compareTo(end) > 0 || end.compareTo(start) < 0) {
//                    JOptionPane.showMessageDialog(null, "Invalid Date", "Error", JOptionPane.ERROR_MESSAGE);
//                } 
                else if (end.isEmpty() || !end.isEmpty()){
                    String grp = String.valueOf(rbGrp.getButtonCount());
                    String add = mi.addEvent(new Event(eveFld.getText(), start, end, grp, syCb.getSelectedItem().toString()), cUser);
                    JOptionPane.showMessageDialog(null, eveFld.getText() + " has been added", "Message", JOptionPane.INFORMATION_MESSAGE);
                }
            }
            
//            if (jButton44.getText().contains("Add")) {
//                syCb.setEnabled(true);
//                typeCb.setEnabled(true);                
//                eveFld.setEditable(true);
//                startChooser.setEnabled(true);
//                endChooser.setEnabled(true);
//                
//                eveFld.setText("");
//                ((JTextField)startChooser.getDateEditor().getUiComponent()).setText("");
//                ((JTextField)endChooser.getDateEditor().getUiComponent()).setText("");
//                jButton44.setText("Save");
//                jButton45.setText("Cancel");
//            } else if (jButton44.getText().contains("Save")) {
//                String start = ((JTextField)startChooser.getDateEditor().getUiComponent()).getText();
//                String end = ((JTextField)endChooser.getDateEditor().getUiComponent()).getText();
//                String eventName = typeCb.getSelectedItem() + ": " + eveFld.getText();
//                if (eveFld.getText().isEmpty() || start.isEmpty() || end.isEmpty()) {
//                    JOptionPane.showMessageDialog(null, "Please fill in the necessary fields", "Error", JOptionPane.ERROR_MESSAGE);
//                    jLabel58.setForeground(Color.red);
//                    jLabel56.setForeground(Color.red);
//                    jLabel57.setForeground(Color.red);
//                } else if (start.compareTo(end) > 0 || end.compareTo(start) < 0) {
//                    JOptionPane.showMessageDialog(null, "Invalid Date", "Error", JOptionPane.ERROR_MESSAGE);
//                } else {
//                    if (typeCb.getSelectedItem().equals("No Classes")) {
//                        compute();                    
//                        String add = mi.addEvent(new Event(eventName, start, end, syCb.getSelectedItem().toString()), cUser);
//                        JOptionPane.showMessageDialog(null, eventName + " has been added", "Message", JOptionPane.INFORMATION_MESSAGE);
//                        eveFld.setText("");
//                        ((JTextField)startChooser.getDateEditor().getUiComponent()).setText("");
//                        ((JTextField)endChooser.getDateEditor().getUiComponent()).setText("");
//                        syCb.setEnabled(false);
//                        typeCb.setEnabled(false);                    
//                        eveFld.setEnabled(false);
//                        ((JTextField)startChooser.getDateEditor().getUiComponent()).setEnabled(false);
//                        ((JTextField)endChooser.getDateEditor().getUiComponent()).setEnabled(false);
//                        syCb.setEnabled(false);
//                        typeCb.setEnabled(false);
//                        jButton44.setText("Add");
//                        jButton45.setText("Edit");
//                    } else {
//                        String add = mi.addEvent(new Event(eventName, start, end, syCb.getSelectedItem().toString()), cUser);
//                        JOptionPane.showMessageDialog(null, eventName + " has been added", "Message", JOptionPane.INFORMATION_MESSAGE);
//                        eveFld.setText("");
//                        ((JTextField)startChooser.getDateEditor().getUiComponent()).setText("");
//                        ((JTextField)endChooser.getDateEditor().getUiComponent()).setText("");
//                        syCb.setEnabled(false);
//                        typeCb.setEnabled(false);                    
//                        eveFld.setEnabled(false);
//                        ((JTextField)startChooser.getDateEditor().getUiComponent()).setEnabled(false);
//                        ((JTextField)endChooser.getDateEditor().getUiComponent()).setEnabled(false);
//                        syCb.setEnabled(false);
//                        typeCb.setEnabled(false);
//                        jButton44.setText("Add");
//                        jButton45.setText("Edit"); 
//                    }
//                }
//            } 
        } catch (Exception e) {
            e.printStackTrace();
        }
        
}//GEN-LAST:event_jButton44ActionPerformed

    public void compute() {
        int schoolDays = 0;
        int diff = 0;
        int i = Integer.valueOf(numLbl.getText());
        Calendar st = Calendar.getInstance();
        Calendar en = Calendar.getInstance();
                                        
        Date s = startChooser.getDate();
        Date e = endChooser.getDate();
                    
        st.setTime(s);
        en.setTime(e);        
                    
        do {
            st.add(Calendar.DAY_OF_MONTH, 1);
                if (st.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && st.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY && en.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && en.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) {
                    diff = i - (schoolDays++);
                }
         } while (st.getTimeInMillis() < en.getTimeInMillis());
            numLbl.setText(String.valueOf(diff));
            //numdays.setText(String.valueOf(schoolDays));
    }
    
    private void jButton45ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton45ActionPerformed
        if (jButton45.getText().equals("Cancel")) {
            eveFld.setEnabled(false);
            ((JTextField)startChooser.getDateEditor().getUiComponent()).setEnabled(false);
            ((JTextField)endChooser.getDateEditor().getUiComponent()).setEnabled(false);
            syCb.setEnabled(false);
//            typeCb.setEnabled(false);
            jButton45.setText("Edit");
            jButton44.setText("Add");
        }
}//GEN-LAST:event_jButton45ActionPerformed

    private void acctTblMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_acctTblMouseClicked
        if(evt.getClickCount() == 2) {
            int x = acctTbl.getSelectedColumn();
            while(x != 0) {
                x--;
            }
            int y = acctTbl.getSelectedRow();
            String val = (String) acctTbl.getValueAt(y, x);
        
            try {  
                selectUser = mi.getUser(val);
                unameFld.setText(selectUser.getUsername());    
                acctCb.setSelectedItem(selectUser.getType());
                gname.setText(selectUser.getGName());
                mname.setText(selectUser.getIMName());
                lname.setText(selectUser.getLName());
                if (acctCb.getSelectedItem().equals("Adviser")) {
                    lvlCategory.setEnabled(false);
                }
            }catch (Exception e) {
                e.printStackTrace();
            }
        }
    }//GEN-LAST:event_acctTblMouseClicked

    private void utypeCbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_utypeCbActionPerformed
//        try {            
//            userList = (ArrayList<User>) mi.get("get-usersearch", utypeCb.getSelectedItem() + "", null);
//            acctNumLbl.setText(userList.size() + "");
//            
//            DefaultTableModel dtm = new DefaultTableModel(new String[] {acctTbl.getColumnName(0), acctTbl.getColumnName(1)}, 0);
//            acctTbl.setModel(dtm);
//            for (int x = 0; x < userList.size(); x++) {
//                User u = userList.get(x);
//                dtm.insertRow(x, new Object[] {u.getUsername(), u.getType()});
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    }//GEN-LAST:event_utypeCbActionPerformed

    private void sumSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sumSearchActionPerformed
        // TODO add your handling code here:
        if(!sumSearchT.getText().isEmpty()) {
            dtmSum.setRowCount(0);
            for(int x = 0; x < profileList.size(); x++) {
                Summer sm = (Summer) profileList.get(x);
                if(sm.getSSID().contains(sumSearchT.getText())) {
                    dtmSum.addRow(new Object[] {sm.getSSID(), sm.getSummerName(), sm.getSSYID()});
                }
            
                if(sm.getSummerName().toLowerCase().contains(sumSearchT.getText().toLowerCase())) {
                    dtmSum.addRow(new Object[] {sm.getSSID(), sm.getSummerName(), sm.getSSYID()});
                }
            }
        }else {
            dtmSum.setRowCount(0);
            for(int x = 0; x < profileList.size(); x++) {
                Summer sm = (Summer) profileList.get(x);
                dtmSum.addRow(new Object[] {sm.getSSID(), sm.getSummerName(), sm.getSSYID()});                
            }
        }
    }//GEN-LAST:event_sumSearchActionPerformed

    private void studTbMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_studTbMouseClicked
//        if (evt.getClickCount() == 2) {
//            int x = studTb.getSelectedColumn();
//            while(x != 0) {
//                x--;
//            }
//            int y = studTb.getSelectedRow();
//            String val = (String) studTb.getValueAt(y, x);
//            
//            try {  
//                s = (Student) mi.get("get-student", "View", val);   
//                new Edit_Student(mi, "View", s, this).setVisible(true);
//                    es.IDNoT.setText(s.getStuID());
//                    es.currCB.setSelectedItem(s.getCurriculum());
//                    es.syCb.setSelectedItem(s.getSchoolYear());
//                    es.clvlCb.setSelectedItem(s.getClassLevel());
//                    es.lNameT.setText(s.getLName());
//                    es.gNameT.setText(s.getGName());
//                    es.mNameT.setText(s.getMNane());
//                    es.cAddT.setText(s.getCAddress());
//                    ((JTextField)es.bdate.getDateEditor().getUiComponent()).setText(s.getBirthday());
//                    es.bPlaceT.setText(s.getBirthPlace());
//                    es.genderCB.setSelectedItem(s.getGender());
//                    es.cAffT.setText(s.getChurchAffiliate());
//                    es.cNoT.setText(s.getContact());
//                    es.faNameT.setText(s.getFatherName());
//                    es.faOccuT.setText(s.getFatherOccupation());
//                    es.faCNoT.setText(s.getFatherContact());
//                    es.moNameT.setText(s.getMotherName());
//                    es.moOccuT.setText(s.getMotherOccupation());
//                    es.moCNoT.setText(s.getMotherContact());
//                    es.lSchlT.setText(s.getLastSchoolAttended());
//                    es.lSchlAddT.setText(s.getLastSchoolAddres());
//                    es.origClvl.setSelectedItem(s.getClassLevel());
//                    es.genAveT.setText(s.getGeneralAverage()); 
//            }catch (Exception e) {
//                e.printStackTrace();
//            }
//        }
    }//GEN-LAST:event_studTbMouseClicked

    private void calTblMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_calTblMouseClicked
        if(evt.getClickCount() == 2) {
            int x = calTbl.getSelectedColumn();
            while(x != 0) {
                x--;
            }
            int y = calTbl.getSelectedRow();
            String val = (String) calTbl.getValueAt(y, x);
        
            try { 
                selectEvent = mi.getEvent(val);                               
                syCb.setSelectedItem(selectEvent.getSyName());
                String[] s = null;
                if(selectEvent.getEventName().contains(":")) {
                    s = selectEvent.getEventName().split(":");
                    eveFld.setText(s[1]);
//                    typeCb.setSelectedItem(s[0]);
                } else {
//                    typeCb.setSelectedItem(selectEvent.getEventName());
                } 
                ((JTextField)startChooser.getDateEditor().getUiComponent()).setText(selectEvent.getStartDate());
                ((JTextField)endChooser.getDateEditor().getUiComponent()).setText(selectEvent.getEndDate());
                numLbl.setText(selectEvent.getNumDays());
            }catch (Exception e) {
                e.printStackTrace();
            }
        }
    }//GEN-LAST:event_calTblMouseClicked

    private void computeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_computeBtnActionPerformed
        if (computeBtn.isEnabled()) {
            compute();
        }        
    }//GEN-LAST:event_computeBtnActionPerformed

    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
        idno = idFld.getText();
       
        if(jComboBox1.getSelectedItem().equals("Report_137basicelem")) {
             new Report_137basicelem(cUser, mi, idno).setVisible(true);
        }else if(jComboBox1.getSelectedItem().equals("Report_137hs")){
            new Report_137HS(cUser, mi, idno).setVisible(true);
        }
    }//GEN-LAST:event_jButton2MouseClicked

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        new Curriculum_Manage(cUser, mi, null, curr).setVisible(true);
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        new ClassLevelM_Manage(cUser, mi).setVisible(true);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jbuttonManageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbuttonManageButtonActionPerformed
        new SubjectM_Manage().setVisible(true);
    }//GEN-LAST:event_jbuttonManageButtonActionPerformed

    private void manageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageButtonActionPerformed
        new SectionM_Manage().setVisible(true);
    }//GEN-LAST:event_manageButtonActionPerformed
    
    public void loadStudentTbl() {
        try {
            studentList = (ArrayList<Student>) mi.getList("getlist-students").clone();
            studNumLbl.setText(studentList.size() + "");
            
            DefaultTableModel dtm = new DefaultTableModel(new String[] {studTb.getColumnName(0), studTb.getColumnName(1), studTb.getColumnName(2), studTb.getColumnName(3), studTb.getColumnName(4), studTb.getColumnName(5), studTb.getColumnName(6), studTb.getColumnName(7)}, 0);
            studTb.setModel(dtm);
            for (int x = 0; x < studentList.size(); x++) {
                Student st = studentList.get(x);
                dtm.insertRow(x, new Object[] {st.getSID(), st.getName(), st.getSchoolYear(), st.getClassLevel(), st.getSection(), st.getGeneralAverage(), st.getCurriculum(), st.getStatus()});
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    public void loadAccountTbl() {
        try {
            userList = (ArrayList<User>) mi.getList("getlist-accounts").clone();
            acctNumLbl.setText(userList.size() + "");
            
            DefaultTableModel dtm = new DefaultTableModel(new String[] {acctTbl.getColumnName(0), acctTbl.getColumnName(1)}, 0);
            acctTbl.setModel(dtm);
            for (int x = 0; x < userList.size(); x++) {
                User us = userList.get(x);
                dtm.insertRow(x, new Object[] {us.getUsername(), us.getType()});
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    public void loadEventTbl() {
        try {
            eventList = (ArrayList<Event>) mi.getList("getlist-event").clone();
            eventNumLbl.setText(eventList.size() + "");
            
            DefaultTableModel dtm = new DefaultTableModel(new String[] {calTbl.getColumnName(0), calTbl.getColumnName(1)}, 0);
            calTbl.setModel(dtm);
            for (int x = 0; x < eventList.size(); x++) {
                Event ev = eventList.get(x);
                dtm.insertRow(x, new Object[] {ev.getEventName(), ev.getSyID()});
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
        
    
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(_UAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(_UAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(_UAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(_UAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new _UAdmin(0, cUser, mi).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox acctCb;
    private javax.swing.JLabel acctNumLbl;
    private javax.swing.JTable acctTbl;
    private javax.swing.JButton addBtn;
    private javax.swing.JPasswordField cPwFld;
    private javax.swing.JTable calTbl;
    private javax.swing.JComboBox clRepCb;
    private javax.swing.JComboBox clevelCb;
    private javax.swing.JButton computeBtn;
    private javax.swing.JComboBox currCB2;
    private javax.swing.JLabel currFld16;
    private javax.swing.JLabel dateL;
    private javax.swing.JButton editBtn;
    private com.toedter.calendar.JDateChooser endChooser;
    private javax.swing.JTextField eveFld;
    private javax.swing.JLabel eventNumLbl;
    private javax.swing.JTextField gname;
    private javax.swing.JTextField idFld;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton16;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton31;
    private javax.swing.JButton jButton33;
    private javax.swing.JButton jButton35;
    private javax.swing.JButton jButton36;
    private javax.swing.JButton jButton37;
    private javax.swing.JButton jButton38;
    private javax.swing.JButton jButton39;
    private javax.swing.JButton jButton40;
    private javax.swing.JButton jButton43;
    private javax.swing.JButton jButton44;
    private javax.swing.JButton jButton45;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel78;
    private javax.swing.JLabel jLabel82;
    private javax.swing.JLabel jLabel84;
    private javax.swing.JLabel jLabel85;
    private javax.swing.JLabel jLabel86;
    private javax.swing.JLabel jLabel87;
    private javax.swing.JLabel jLabel88;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel27;
    private javax.swing.JPanel jPanel28;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JRadioButton jRadioButton3;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JButton jbuttonManageButton;
    private javax.swing.JTextField lname;
    private javax.swing.JComboBox lvlCategory;
    private javax.swing.JTabbedPane mainP;
    private javax.swing.JButton manageButton;
    private javax.swing.JTextField mname;
    private javax.swing.JRadioButton noclassRB;
    private javax.swing.JLabel numLbl;
    private javax.swing.JPasswordField pwFld;
    private javax.swing.ButtonGroup rbGrp;
    private javax.swing.JTextField searchFld1;
    private javax.swing.JTextField searchFld2;
    private javax.swing.JTextField searchFld4;
    private javax.swing.JTextField searchFld5;
    private javax.swing.JComboBox secCb;
    private com.toedter.calendar.JDateChooser startChooser;
    private javax.swing.JLabel studNumLbl;
    public javax.swing.JTable studTb;
    private javax.swing.JTable studTbl;
    private javax.swing.JLabel sumFld;
    private javax.swing.JButton sumSearch;
    private javax.swing.JTextField sumSearchT;
    private javax.swing.JTable sumstudTbl;
    private javax.swing.JComboBox sumsyCB;
    private javax.swing.JComboBox syCB1;
    private javax.swing.JComboBox syCB5;
    private javax.swing.JComboBox syCb;
    private javax.swing.JComboBox syRepCb;
    private javax.swing.JLabel timeL;
    private javax.swing.JTextField unameFld;
    private javax.swing.JTable userTbl;
    private javax.swing.JLabel usernameL;
    private javax.swing.JComboBox utypeCb;
    private javax.swing.JRadioButton wclassRB;
    // End of variables declaration//GEN-END:variables
}
